ifeq ($(TOP_DIR),) 
ifeq ($(strip $(TARGET_BUILD_TYPE)),debug)
    EXTRA_CFLAGS += -DCFG_BUILD_DEBUG
endif

KERNEL_DIR :=$(srctree)
EXTRA_CFLAGS += -I$(PWD)/driver/src/kernel/nor_flash
EXTRA_CFLAGS += -I$(PWD)/drivers/dev_inc
EXTRA_CFLAGS += -I$(PWD)/inc

EXTRA_CFLAGS += -I$(PWD)/drivers/dev_plat/common

ifeq ($(strip $(TARGET_BUILD_TYPE)),debug)
    EXTRA_CFLAGS += -I$(PWD)/drivers/unreleased/dft
endif

obj-m += drv_nor_flash.o
drv_nor_flash-objs := hisfc300.o spi_ids.o drv_whitelist.o

else

ifeq ($(strip $(TARGET_BUILD_TYPE)),debug)
    EXTRA_CFLAGS += -DCFG_BUILD_DEBUG
endif


EXTRA_CFLAGS += -I$(TOP_DIR)/driver/src/kernel/nor_flash
EXTRA_CFLAGS += -I$(TOP_DIR)/drivers/dev_inc
EXTRA_CFLAGS += -I$(TOP_DIR)/inc

EXTRA_CFLAGS += -I$(TOP_DIR)/drivers/dev_plat/common

ifeq ($(strip $(TARGET_BUILD_TYPE)),debug)
    EXTRA_CFLAGS += -I$(TOP_DIR)/drivers/unreleased/dft
endif

obj-m += drv_nor_flash.o
drv_nor_flash-objs := hisfc300.o spi_ids.o drv_whitelist.o

endif
